package snippet;

public class T944 {
	public static void main(String[] args) {
		String[] a= {"cba", "daf", "ghi"};
		System.out.println(new T944().minDeletionSize(a));
	}
	 public int minDeletionSize(String[] A) {
		 int count=0;
		for (int i = 0; i < A[0].length(); i++) {
			for (int j = 0; j < A.length-1; j++) {
				
				if(A[j].charAt(i)-'0'<=A[j+1].charAt(i)-'0') {}
				else {
					count++;
					break;
				}
			}
		}
		return count;
	        
	    }
}
